#ifndef KBE_DB_TRANSACTION_HELPER_H
#define KBE_DB_TRANSACTION_HELPER_H

class DBInterface;

/**
 */
class DBTransaction
{
public:
	DBTransaction(DBInterface* dbi, bool autostart = true);
	~DBTransaction();
	
	void start();
	void end();

	void commit();

	bool shouldRetry() const;

	void pdbi(DBInterface* dbi){ dbi_ = dbi; }
private:
	DBInterface* dbi_;
	bool committed_;
	bool autostart_;
};

#endif // KBE_DB_TRANSACTION_HELPER_H

